<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'runtimePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'tmp',
	'name'=>'YiiTravel Application',
	'sourceLanguage'=>'en',
	'language'=>'vi',
	// preloading 'log' component
	'preload'=>array('log'),
	'defaultController'=>'default',
	'theme'=>'classic',
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),
	
	'modules'=>array(
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'qaz123',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		'admin'=>array(
			'modules'=>array(
				'settings',
			),
		),
		'default',
		'user'
	),
	
	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'urlFormat'=>'path',
			'class'=>'LangUrlManager',
			'showScriptName'=>false,
			
			'rules'=>array(
				
				//Users module rules
				'<lang:\w+>/user/login'=>'user/default/login',
				'<lang:\w+>/user/register'=>'user/default/create',
				'admin'=>'admin/default/index',
				//Default rules
				'<lang:\w+>/<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
				'<lang:\w+>/<module:\w+>'=>'<module>/default/index',
				'<lang:\w+>/<controller:\w+>/<action:\w+>/<view:\w+>'=>'<controller>/<action>',
				'<lang:\w+>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				'<lang:\w+>'=>'/',
				
			),
			
		),
		
		/*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		*/
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=project_yiicustom',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'qaz123',
			'charset' => 'utf8',
		),
		'authManager'=>array(
            'class'=>'CRbacManager',
            'connectionID'=>'db',
        ),
		'coreMessages'=>array(
			'class'=>'CPhpMessageSource',
		),
		'locale'=>array(
			'class'=>'Locale',
		),
		'email'=>array(
			'class'=>'CPhpMailer',
			'host'=>'smtp.gmail.com',
			'port'=>465,
			'auth'=>true,
			'secure'=>'ssl',
			'username'=>'queeenearning@gmail.com',
			'password'=>'danhhau437060',
			'debug'=>false,
		)
		,
		'messages'=>array(
			//If you want to store stralation string in .php file we can use the bellow
			//'class'=>'CPhpMessageSource',
			//'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'translation',
			//If you want to store stralation string in .mo or .po file we can use the below
			//'class'=>'CGettextMessageSource',
			//'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'translation',
			//If you want to store stranslation string in database we can use the below
			'class'=>'AutoCDbMessageSource',
			'sourceMessageTable'=>'sourceMessage',
			'translatedMessageTable'=>'translatedMessage'
			//'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'translation',
		),
		/*
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		*/
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);